<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    //无参数无输出
   function f1() {
       let i = 1;
       document.write(i);
   }

   f1();
    document.write("<br>");

   //有参数有输出
    function f2(num1,num2) {
        return num1 + num2;
    }

    let num = f2(10, 20);
    document.write(num);

    document.write("<br>");
    //可变参数
    function f3(...arr) {
        let num = 0;
        for(let i=0;i<arr.length; i++){
            num += arr[i];
        }
        return num;
    }

    let n = f3(10,20,30);
    document.write(n);

    let num1 = function () {
        alert("0000000000");
    }
    num1();
</script>
</html>